package com.bookstore.service.impl;

import com.bookstore.dao.ProductDao;
import com.bookstore.dao.impl.ProductDaoImpl;
import com.bookstore.entity.Product;
import com.bookstore.service.ProductService;

import java.util.List;

public class ProductServiceImpl implements ProductService {
    ProductDao productDao = new ProductDaoImpl();

    @Override
    public int insert(Product product) {
        return productDao.insert(product);
    }

    @Override
    public int update(Product product) {
        return productDao.update(product);
    }

    @Override
    public int delete(Long id) {
        return productDao.delete(id);
    }

    @Override
    public List<Product> queryAll() {
        return productDao.queryAll();
    }

    @Override
    public Product queryById(Long id) {
        return productDao.queryById(id);
    }
}
